<?php

namespace App\Http\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class Record extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function toArray($request)
    {

        return [
            'id' => $this->id,
            'department_id' => $this->department_id,
            'department_name' => $this->department->name,
            'business_id' => $this->business_id,
            'business_name' => $this->business->name,
            'data_cycle' => $this->business->data_cycle,
            'evaluation_result' => $this->evaluation_result,
            'record_date' => $this->record_date,
            'value' => $this->value,
        ];
    }
}
